Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[emojicoin] Add fees #2140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gregnazario
Copy link

No description provided.

@llamatester
Copy link

The emojicoin.ts adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees emojicoin.ts

🦙 Running EMOJICOIN.TS adapter 🦙
---------------------------------------------------
Start Date:	Tue, 26 Nov 2024 00:00:00 GMT
End Date:	Wed, 27 Nov 2024 00:00:00 GMT
---------------------------------------------------

APTOS 👇
Backfill start time: 3/4/2023
NO METHODOLOGY SPECIFIED
Total fees: 2547.51 B
Daily fees: 8.00 B
End timestamp: 1732665599 (2024-11-26T23:59:59.000Z)

@gregnazario gregnazario marked this pull request as ready for review November 27, 2024 20:22
@llamatester
Copy link

The emojicoin.ts adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees emojicoin.ts

🦙 Running EMOJICOIN.TS adapter 🦙
---------------------------------------------------
Start Date:	Tue, 26 Nov 2024 00:00:00 GMT
End Date:	Wed, 27 Nov 2024 00:00:00 GMT
---------------------------------------------------

APTOS 👇
Backfill start time: 3/4/2023
NO METHODOLOGY SPECIFIED
Total fees: 304.94 k
Daily fees: 958
End timestamp: 1732665599 (2024-11-26T23:59:59.000Z)

@@ -1,22 +1,29 @@
import { httpGet } from "../utils/fetchURL";
import {httpGet, httpPost} from "../utils/fetchURL";

export const APTOS_PRC = 'https://aptos-mainnet.pontem.network';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const APTOS_PRC = 'https://aptos-mainnet.pontem.network';
export const APTOS_RPC = 'https://aptos-mainnet.pontem.network';

let lastData: any;
let cursor
do {
let url = `${APTOS_PRC}/v1/accounts/${account}/resources?limit=9999`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let url = `${APTOS_PRC}/v1/accounts/${account}/resources?limit=9999`
let url = `${APTOS_RPC}/v1/accounts/${account}/resources?limit=9999`

return {
totalFees: `${totalFees}`,
dailyFees: `${dailyFees}`,
// TODO: revenue
Copy link

@xbtmatt xbtmatt Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revenue can just be the integrator fees (what you're already using for total/daily)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so fees = revenue?


const ONE_DAY: number = (24 * 60 * 60 * 1000);

const fetch = async (timestamp: number) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to adapter version 2, then you get start and endTimestamp as part of input

const yesterdayRegistry = await registryView(BigInt(closestToPreviousDate))
const todayRegistry = await registryView(BigInt(closestToDate))

const prices = await getPrices(["coingecko:aptos"], timestamp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid pulling token prices and change code to something like this

Copy link
Member

@g1nt0ki g1nt0ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@g1nt0ki
Copy link
Member

g1nt0ki commented Dec 11, 2024

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants